import request from '@/utils/request'

// 获取所有角色列表
export async function getRolesList(){
    let res = await request({
        url:"/roles",
        method:"get",
        // data:params
    })
    return res
}

// 删除角色制定权限
export async function delRolesRight(params){
    let res = await request({
        url:`/roles/${params.roleId}/rights/${params.rightId}`,
        method:"delete",
        // data:params
    })
    return res
}

// 给角色授权
export async function setRights(roleId,rids){
    
    // let rids = params.rids
    let res = await request({
        url:`/roles/${roleId}/rights`,
        method:"post",
        data:rids
    })
    return res
}
